package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.DstArticleDTO;
import com.financing.wap.dao.IDstArticleDao;
import com.financing.wap.common.SqlName;
/**
 * dst_article  
 * 文章列表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("dstArticleDao")
public class DstArticleDaoImpl extends BaseDaoImpl<DstArticleDTO, java.lang.Integer> implements IDstArticleDao {


	@Override
	public int insert(DstArticleDTO dstArticle) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.DstArticleSql.insert, dstArticle);
	}

	@Override
	public void update(DstArticleDTO dstArticle) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstArticleSql.update, dstArticle);
	}

	@Override
	public void updateForce(DstArticleDTO dstArticle) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstArticleSql.updateForce, dstArticle);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.DstArticleSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<DstArticleDTO> queryList(DstArticleDTO dstArticle) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.DstArticleSql.queryList, dstArticle);
	}

	@Override
	public int queryListCount(DstArticleDTO dstArticle) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.DstArticleSql.queryListCount, dstArticle);
	}

	@Override
	public DstArticleDTO loadById(Integer id) throws SQLException {
		return  (DstArticleDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.DstArticleSql.loadById,id);
	}

	@Override
	public Class<DstArticleDTO> getEntityClass() {
		return DstArticleDTO.class;
	}
 	
}
